USE [SRD]
GO

/****** Object:  Table [dbo].[PROJETO]    Script Date: 05/14/2011 11:00:45 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[PROJETO](
	[PROJETO_ID] [int] IDENTITY(1,1) NOT NULL,
	[NM_PROJETO] [nvarchar](30) NOT NULL,
	[EMPRESA_ID] [int] NOT NULL,
	[CENTRO_CUSTO_ID] [int] NOT NULL,
	[LIDER_ID] [int] NOT NULL,
	[ATIVO] [char](1) NOT NULL,
 CONSTRAINT [PK_PROJETO] PRIMARY KEY CLUSTERED 
(
	[PROJETO_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[PROJETO]  WITH CHECK ADD  CONSTRAINT [FK_PROJETO_CENTRO_CUSTO] FOREIGN KEY([CENTRO_CUSTO_ID])
REFERENCES [dbo].[CENTRO_CUSTO] ([CENTRO_CUSTO_ID])
GO

ALTER TABLE [dbo].[PROJETO] CHECK CONSTRAINT [FK_PROJETO_CENTRO_CUSTO]
GO

ALTER TABLE [dbo].[PROJETO]  WITH CHECK ADD  CONSTRAINT [FK_PROJETO_EMPRESA] FOREIGN KEY([EMPRESA_ID])
REFERENCES [dbo].[EMPRESA] ([EMPRESA_ID])
GO

ALTER TABLE [dbo].[PROJETO] CHECK CONSTRAINT [FK_PROJETO_EMPRESA]
GO

ALTER TABLE [dbo].[PROJETO]  WITH CHECK ADD  CONSTRAINT [FK_PROJETO_PROFISSIONAL] FOREIGN KEY([LIDER_ID])
REFERENCES [dbo].[PROFISSIONAL] ([PROFISSIONAL_ID])
GO

ALTER TABLE [dbo].[PROJETO] CHECK CONSTRAINT [FK_PROJETO_PROFISSIONAL]
GO


